<include file="public/layout"/>
<style>
    .te_le .dataTables_paginate{float: left;}
    .bot{float: right;padding: 15px 0}
</style>
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div class="page" style="padding: 0px 1% 0 1%;">
    <!-- 操作说明 -->
    <div class="flexigrid">
        <div class="mDiv">
            <div class="ftitle">
                <h3>用户列表</h3>
                <h5>(共{$page->totalRows}条记录)</h5>
            </div>
            <div title="刷新数据" class="pReload"><i class="fa fa-refresh"></i></div>
            <form class="navbar-form form-inline" id="search-form2" action="{:U('User/search_users',array('tpl'=>'select_users'))}" method="get">
                <div class="sDiv">
                    <div class="sDiv2" style="margin-right: 10px;border:none;">
                    <!--<div class="sDiv2">-->
                        <!--<input size="30" name="keywords" value="{$Request.param.keywords}" class="qsbox" placeholder="关键词" type="text">-->
                        <!--<input class="btn" value="搜索" type="submit">-->
                    <!--</div>-->
                        <div class="sDiv2">
                            <input size="30" name="id" value="{$Request.param.id}" class="qsbox" placeholder="用户id" type="hidden">
                            <input size="30" name="id" value="{$Request.param.id}" class="qsbox" placeholder="用户id" type="text">
                            <input class="btn" value="搜索" type="submit">
                        </div>
                </div>
            </form>
        </div>
        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0">
                    <thead>
                    <tr>
                        <th abbr="article_title" axis="col3" class="" align="left">
                            <div style="text-align: left; width: 50px;" class="">选择</div>
                        </th>
                        <th abbr="article_title" axis="col3" class="" align="left">
                            <div style="text-align: left; width: 50px;" class="">ID</div>
                        </th>
                        <th abbr="article_time" axis="col6" class="" align="left">
                            <div style="text-align: center; width: 120px;" class="">用户头像</div>
                        </th>
                        <th abbr="article_time" axis="col6" class="" align="center">
                            <div style="text-align: center; width: 100px;" class="">用户昵称</div>
                        </th>
                        <th style="width:100%" axis="col7">
                            <div></div>
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <div class="bDiv" style="height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table>
                    <tbody>
                    <tr>
                        <td class="" align="left">
                            <div style="text-align: left; width: 50px;">
                                <input type="radio" name="id" data-head_pic="{$list.head_pic|default='__PUBLIC__/static/images/seller/default_user_portrait.gif'}"
                                       data-id="0" data-nickname="厂家"/>
                            </div>
                        </td>
                        <td class="" align="left">
                            <div style="text-align: left; width: 50px;">0</div>
                        </td>
                        <td class="" align="center" style="text-align: center">
                            <div style="text-align: center; width: 120px;"><img width="80" height="80" src="{$list.head_pic|default='__PUBLIC__/static/images/seller/default_user_portrait.gif'}" alt=""></div>
                        </td>
                        <td class="" align="center">
                            <div style="text-align: center; width: 100px;">厂家</div>
                        </td>
                        <td class="" style="width: 100%;" align="">
                            <div>&nbsp;</div>
                        </td>
                    </tr>
                    <volist name="goodsList" id="list">
                        <tr>
                            <td class="" align="left">
                                <div style="text-align: left; width: 50px;">
                                    <input type="radio" name="id" data-head_pic="{$list.head_pic|default='__PUBLIC__/static/images/seller/default_user_portrait.gif'}"
                                           data-id="{$list.id}" data-nickname="{$list.nickname}"
                                           <if condition="$list['id'] eq $Request.param.id">checked='checked'</if>/>
                                </div>
                            </td>
                            <td class="" align="left">
                                <div style="text-align: left; width: 50px;">{$list.id}</div>
                            </td>
                            <td class="" align="center">
                                <div style="text-align: center; width: 120px;"><img width="80" height="80" src="{$list.head_pic|default='__PUBLIC__/static/images/seller/default_user_portrait.gif'}" alt=""></div>
                            </td>
                            <td class="" align="center">
                                <div style="text-align: center; width: 100px;">{$list.nickname}</div>
                            </td>
                            <td class="" style="width: 100%;" align="">
                                <div>&nbsp;</div>
                            </td>
                        </tr>
                    </volist>
                    </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>
        <!--分页位置-->
        <div class="te_le">
            {$page->show()}
        </div>
        <div class="bot"><a onclick="select_goods();" class="ncap-btn-big ncap-btn-green">确认提交</a></div>
    </div>
</div>
<style>
    .flexigrid .bDiv td div, .colCopy div {
        height: 106px;
    }
</style>
<script>
    $(document).ready(function(){
        $("input[type='radio']:checked").each(function(i,o){
            var goods_id = $(this).data('id');
            $('#spec_goods_id_'+goods_id).show();
        })
    });
    //单选框选中事件
    $(function () {
        $(document).on("click", '#flexigrid input', function (e) {
            var goods_id = $(this).data('id');
            if($(this).is(':checked')){
                $('#spec_goods_id_'+goods_id).show();
            }else{
                $('#spec_goods_id_'+goods_id).hide();
            }
        })
    })
    //规格按钮点击事件
    $(function () {
        $(document).on("click", '.specBtn', function (e) {
            $(this).parent().find('a').css("color","#777").removeClass('ncap-btn-green');
            $(this).css("color","#FFF").addClass('ncap-btn-green');
        })
    })

    function select_goods()
    {
        var input = $("input[type='radio']:checked");
        if (input.length == 0) {
            layer.alert('请选择用户', {icon: 2}); //alert('请选择商品');
            return false;
        }
        var user_id = input.data('id');
        var nickname = input.data('nickname');
        var head_pic = input.data('head_pic');
        window.parent.call_back(user_id,nickname,head_pic);
    }
</script>
</body>
</html>